package com.web.oa.service.impl;

import com.web.oa.mapper.BaoxiaoBillMapper;
import com.web.oa.pojo.BaoxiaoBill;
import com.web.oa.pojo.BaoxiaoBillExample;
import com.web.oa.service.BaoxiaoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class BaoxiaoServiceImpl implements BaoxiaoService {
    @Autowired
    private BaoxiaoBillMapper baoxiaoBillMapper;

    @Override
    public List<BaoxiaoBill> findBaoxiaoByUserList(long id) {
        //通过BaoxiaoBillExample创建对象
        BaoxiaoBillExample example=new BaoxiaoBillExample();
        //通过创建的对象来构造查询对象
        BaoxiaoBillExample.Criteria criteria = example.createCriteria();
        criteria.andUserIdEqualTo(id);
        return baoxiaoBillMapper.selectByExample(example);
    }

    @Override
    public BaoxiaoBill findBaoxiaoBillId(Long id) {
        return baoxiaoBillMapper.selectByPrimaryKey(id);
    }

}
